<%@ page import="cn.dai.util.JdbcUtils" %>
<%@ page import="java.sql.Connection" %>
<%@ page import="cn.dai.pojo.Java30" %>
<%@ page import="java.util.List" %><%--
  Created by IntelliJ IDEA.
  User: Administrator
  Date: 2020/6/3
  Time: 11:24
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>后台面板</title>
</head>

<body>
    <h3>这是后台面板页面</h3>

    <%-- 查询所有信息 --%>

<%
    Connection connection = JdbcUtils.getConnection();

    String sql = "SELECT * FROM java30";

    List<Java30> java30List = JdbcUtils.queryToList(connection, Java30.class, sql, null);
%>

<table border="1" style="text-align: center" width="50%">

   <p> <strong> <a href="panel_add.jsp">[ 添加学员 ]</a> </strong> </p>

    <tr>
        <td> 学员ID </td>
        <td> 学员姓名 </td>
        <td> 学员电话 </td>
        <td> 学员QQ </td>
        <td> 操作 </td>
    </tr>
<%
    for (Java30 student: java30List){
%>
    <tr>
        <td><%= student.getJ30_id()%></td>
        <td><%= student.getJ30_name()%></td>
        <td><%= student.getJ30_phone()%></td>
        <td><%= student.getJ30_qq()%></td>
        <td>
            <a href="panel_update.jsp?id=<%= student.getJ30_id()%>"> 修改学员</a> |
            <a href="panel_del_action.jsp?id=<%= student.getJ30_id()%>"> 删除学员</a>
        </td>
    </tr>
<%
    }
%>
</table>
</body>
</html>
